<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter"%>
<%@ page import="org.apache.shiro.authc.ExcessiveAttemptsException"%>
<%@ page import="org.apache.shiro.authc.IncorrectCredentialsException"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<!DOCTYPE html>
<html lang="zh-CN" class="bootstrap-admin-vertical-centered">
  <head>
    <title>Worktile 让工作更简单 - Worktile</title>
    
    <meta name="author" content="yctech" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="maximum-scale=1.0,width=device-width,initial-scale=1.0" />
    <meta name="keywords" content="团队协同,项目管理,任务管理,项目协作,在线办公,协作办公,SAAS,云协作,企业办公" />
    <meta name="description" content="worktile，让工作更简单。Worktile是一个团队协同工具，通过简单的协作、沟通和分享，实现团队交互与任务管理的轻松协作。工作随身带，多平台、云数据，随时随地与团队一起工作，项目、任务、文件、话题、文档、事件、活动流、通知和日历，一个都不能少。" />
	<link type="image/x-icon" href="${ctx}/static/images/favicon.ico" rel="shortcut icon">
	<link href="${ctx}/static/bootstrap/3.2.0/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
	<link href="${ctx}/static/bootstrap/3.2.0/css/bootstrap-theme.min.css" type="text/css" rel="stylesheet" />
	<link href="${ctx}/static/styles/css/bootstrap-admin-theme/bootstrap-admin-theme.css" type="text/css" rel="stylesheet" />
	<link href="${ctx}/static/jquery-validation/1.10.0/validate.css" type="text/css" rel="stylesheet" />
	<link href="${ctx}/static/styles/default.css" type="text/css" rel="stylesheet" />
	<script src="${ctx}/static/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
	<script src="${ctx}/static/jquery-validation/1.10.0/jquery.validate.min.js" type="text/javascript"></script>
	<script src="${ctx}/static/jquery-validation/1.10.0/messages_bs_zh.js" type="text/javascript"></script>
	<script src="${ctx}/static/bootstrap/3.2.0/js/bootstrap.min.js" type="text/javascript"></script>

    <!--[if lt IE 9]>
    <script src="${ctx}/js/iejs/html5shiv/3.6.2/html5shiv.js"></script>
    <script src="${ctx}/js/iejs/respond/1.1.0/respond.js"></script>
    <![endif]-->
    <!--[if lte IE 8]>
    <script src="${ctx}/js/iejs/json/json2.js"></script>
    <![endif]-->

	<!-- Custom styles -->
	<style type="text/css">
	.alert {
		margin: 0 auto 20px;
	}
	</style>

  </head>

  <body class="bootstrap-admin-without-padding">
  	<div class="container">
  		<div class="row">
  			<%
				String error = (String) request.getAttribute(FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME);
				if(error != null){
			%>
  			<div class="alert alert-info">
            	<a class="close" data-dismiss="alert" href="#">&times;</a>
            	请输入正确的用户名和密码！
  			</div>
  			<%
			}
			%>
  			<form id="loginForm" method="post" action="${ctx}/login" class="bootstrap-admin-login-form">
  				<h1>登录</h1>
  				<div class="form-group">
                	<input class="form-control" type="text" id="username" name="username" placeholder="用户名">
  				</div>
  				<div class="form-group">
                	<input class="form-control" type="password" id="password" name="password" placeholder="密码">
               	</div>
               	<div class="form-group">
                	<label>
                    	<input type="checkbox" id="rememberMe" name="rememberMe">
                           	记住我
                    </label>
                </div>
                <button class="btn btn-lg btn-primary" type="submit">提交</button>
                <a class="btn" href="${ctx}/register">注册</a>
				<span class="help-block">(管理员: <b>admin/admin</b>, 普通用户: <b>user/user</b>)</span>
  			</form>
  		</div>
  	</div>




    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
	<script>
		$(document).ready(function() {
			$("#loginForm").validate();
		});
	</script>
    
  </body>
</html>
